<?php
namespace app\index\controller;

use Services\CloudOpen\User;
use think\Controller;

/**
 * 鉴权控制器
 * Class Auth
 * @package app\index\controller
 */
class Auth extends Controller
{
    /**
     * 用户登录
     */
    public function login()
    {
        if(request() -> isPost()){
            // 账号
            $account = $this -> request -> request('account');
            // 密码
            $password = $this -> request -> request('password');
            // TODO 注册
            return json(['status'=>200,'msg'=>'注册成功']);
        }else{
            return $this -> fetch();
        }
    }

    /**
     * 用户注册
     */
    public function register()
    {
        if(request() -> isPost()){
            // 账号
            $account = $this -> request -> request('account');
            // 密码
            $password = $this -> request -> request('password');
            // TODO 注册
            return json(['status'=>200,'msg'=>'登录成功']);
        }else{
            return $this -> fetch();
        }
    }
}